/**
 * @file Service_1.h
 *
 * @author Federico Consoli
 *
 * Released under GNU GPLv3 (http://www.gnu.org/licenses/gpl-3.0.txt)
 */

#ifndef SERVICE1_H
#define	SERVICE1_H

// Max image size before to do the trim function
#define MAX_IMG_SIZE 1000

// Max image size before to do the crop function
#define MAX_CROP_SIZE 1600
#include "libreria.h"
#include <Magick++.h>

using namespace std;
using namespace Magick;

/** Implementation of the Service_1 class.
 *  This class can rotate or mirror an image
 *
 */
class Service_1 : public Response {
    /** Base Ip address of the services provider, each services will
     * increment it of 1 */
    string ip;
    /** Base port of the services provider, each services will
     * increment it of +1 so if you got 5 services and <b> porta_base </b>= 40000
     *  the port 40000, 40001, 40002 and 40004 will be used */
    unsigned short porta_base;

public:
    /**
     * Constructor of Service_1 class.
     * @param nuovo_ip @link Service_1::ip Ip @endlink of services.
     * @param nuovo_porta_base @link Service_1::porta_base Porta_base @endlink of the service
     * @param name_of_service @link Service::name name @endlink of the services
     */
    Service_1(string nuovo_ip = "127.0.0.1", unsigned short nuovo_porta_base = 30000, string name_of_service = "SERVICE 1");

    /**
     * Destroyer.
     */
    ~Service_1();

    /**
     * Set the name of the Server class and display the menu
     * @param registro_locale Pointer to Server class
     */
    void menu(Server*);
    /**
     * Rotate an image
     * @param R Pointer to the Response class
     * @param sd Socket descriptor of the connection to the @link Client client@endlink.
     */
    void rotate(Response *, int);

    /**
     * Mirror an image
     * @param R Pointer to the Response class
     * @param sd Socket descriptor of the connection to the @link Client client@endlink.
     */
    void mirror(Response *, int);

};

#endif	/* SERVICE1_H */

